﻿<%@ Page Language="C#" MasterPageFile="~/WebMaster/MasterPage.master"
	CodeFile="Albums.aspx.cs" Theme="WebMaster" Inherits="webapp4U.UI.Admin.Albums" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="server">

<uc:Title ID="Title1" runat="server" ResourceKey='' strMsg="Thư viện hình ảnh"  />

	<div class="page" align="center">

        <asp:Panel runat="server" GroupingText="Tạo Albums" Width="350">
		<table cellpadding="7" border="0" align="center">
		    <tr>
		        <td colspan="2">
		        <asp:ValidationSummary runat="server" ValidationGroup="AlbumAdd" ID="valChangePasswordSummary"  ShowMessageBox="true" ShowSummary="false" />			
		        <asp:Label runat="server" ForeColor="#E6CD84" ID="lblMsg" Visible="false"></asp:Label></td>
		    </tr>
		     <tr class="Hidden">
		        <td align="right">Hình đại diện:</td>
		        <td align="left"><asp:FileUpload ID="FilePhoto" Runat="server" Width="208"  /></td>
		    </tr>
		    <tr class="Hidden">
		        <td align="right">Thư mục:</td>
		        <td>
		            <asp:TextBox ID="txtAppKey" Runat="server" Width="200"  />
			        <asp:RequiredFieldValidator Enabled="false" SetFocusOnError="true" ID="RFV2" ForeColor="#E6CD84" ValidationGroup="AlbumAdd" Runat="server" ErrorMessage="Bạn phải nhập thư mục để chứa hình." ControlToValidate="txtAppKey" Display="none"/>
			        <asp:RegularExpressionValidator Enabled="false" ForeColor="#E6CD84" SetFocusOnError="true" ValidationGroup="AlbumAdd" ID="RegularExpressionValidator1" ControlToValidate="txtAppKey" runat="server"
                             ValidationExpression="^(([a-zA-Z0-9-_])+)$" 
                             ErrorMessage="Không được dùng khoản trắng hay các kí tự đặt biệt để tạo thư mục!" Display="none">
                    </asp:RegularExpressionValidator>
		        </td>
		    </tr>
		    <tr>
		        <td align="right">Tiêu đề (vn):</td>
		        <td align="left">
		            <asp:TextBox ID="txtAlbumName" Runat="server" Width="200"  />
    		        <asp:RequiredFieldValidator SetFocusOnError="true" ID="RFV1" ForeColor="#E6CD84" ValidationGroup="AlbumAdd" Runat="server" ErrorMessage="Bạn phải nhập tiêu đề cho album." ControlToValidate="txtAlbumName" Display="none"/>
		        </td>
		    </tr>
		     <tr>
		        <td align="right">Tiêu đề (en):</td>
		        <td align="left">
		            <asp:TextBox ID="txtAlbumName_en" Runat="server" Width="200"  />
    		        <asp:RequiredFieldValidator SetFocusOnError="true" ID="RequiredFieldValidator1" ForeColor="#E6CD84" ValidationGroup="AlbumAdd" Runat="server" ErrorMessage="Bạn phải nhập tiêu đề cho album." ControlToValidate="txtAlbumName_en" Display="none"/>
		        </td>
		    </tr>
		    <tr>
		        <td align="right">Sắp xếp:</td>
		        <td align="left">
		            <asp:TextBox ID="txtCateOrder" Runat="server" Width="200" Text="0"  />
			        <asp:RegularExpressionValidator ForeColor="#E6CD84" SetFocusOnError="true" ValidationGroup="AlbumAdd" ID="RegularExpressionValidator2" ControlToValidate="txtCateOrder" runat="server"
                             ValidationExpression="^(([0-9])+)$" 
                             ErrorMessage="Vị trí sắp xếp phải là kiểu số nguyên" Display="none">
                    </asp:RegularExpressionValidator>
		        </td>
		    </tr>
		    <tr class="Hidden">
		        <td align="right">
				   Giới thiệu:
		        </td>
		        <td align="left">
		            <asp:TextBox ID="txtAlbumDesc" Runat="server" Rows="4" TextMode="MultiLine"  Width="200"  />
		        </td>
		    </tr>
		    <tr class="Hidden">
		        <td colspan="2">
		             <asp:CheckBox ID="chkIsPrivate" Runat="server" text="Album Private" />
		        </td>
		    </tr>
		    <tr>
		        <td colspan="2" align="right">
		            <asp:Button ID="btAlbumAdd" Runat="server" ValidationGroup="AlbumAdd" Text="Save" OnClick="AlbumsAdd_Click"/>
		        </td>
		    </tr>
		</table>
		</asp:Panel>
        
        <table width="700" align="center">
            <tr>
                <td align="center">
                    <br />
                    <asp:GridView runat="server" Width="700" DataSourceID="ItemDataSource" ID="GridViewItem">
                        <Columns>
                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                <HeaderTemplate>
                                    <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                        type="checkbox" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("CateID") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Bosuutap" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                <HeaderTemplate>Tên thư viện(vn)</HeaderTemplate>
                                <ItemTemplate>
                                    <a href="Photos.aspx?CateID=<%# Eval("CateID") %>"><u><%# Eval("CateName") %></u></a> 
                                </ItemTemplate>
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Bosuutap" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                <HeaderTemplate>Tên thư viện(en)</HeaderTemplate>
                                <ItemTemplate>
                                    <a href="SlideShow.aspx?CateID=<%# Eval("CateID") %>"><u><%# Eval("CateName_en") %></u></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="Sắp xếp" ItemStyle-Width="100" HeaderStyle-Width="100" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center">
                                <HeaderTemplate>Sắp xếp</HeaderTemplate>
                                <ItemTemplate>
                                    <%# Eval("CateOrder") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                                                        
                            <asp:TemplateField HeaderText="Edit" ItemStyle-Width="40" HeaderStyle-Width="40" 
                                HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                <HeaderTemplate><%=ResourceManager.GetString("Edit")%></HeaderTemplate>
                                <ItemTemplate>
                                    <a href="Albums.aspx?CateID=<%# Eval("CateID") %>&Action=Edit">
                                        <img src="<%=Globals.ImagesUrlWebMaster()%>Edit.gif" border="0" />
                                    </a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            
                        </Columns>
                        <EmptyDataTemplate>
                            <table align="center" width="300" border="0" bordercolorlight="#0099cc" bordercolor="#0099cc">
                                <tr>
                                    <td height="50" align="center">
                                        <div align="center" id="EmptyData">
                                            <%=ResourceManager.GetString("DataEmpty") %>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <br />
                    <asp:LinkButton runat="server" ID="btDelete" Text=" Delete " OnClick="btDelete_Click" />
                    <br />
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td>
                    <u>Ghi chú:</u> Click vào tên Album nếu bạn muốn cập nhất hình ảnh cho Albums đó.
                </td>
            </tr>
        </table>
	</div>
	
	<asp:ObjectDataSource ID="ItemDataSource" Runat="server" 
	    TypeName="webapp4U.BOL.PhotoCategory"
		SelectMethod="GetAlbums">
	</asp:ObjectDataSource>

</asp:content>
